#!/usr/bin/python3
# coding=utf-8
#
# Copyright (C) 2023-2024. Huawei Technologies Co., Ltd. All rights reserved.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# ===============================================================================
import numpy as np
import os
import torch


def gen_golden_data_simple():

    input_x1 = np.random.randint(-100, 100, [999999]).astype(np.int16)
    input_x2 = np.random.randint(-100, 100, [999999]).astype(np.int16)

    x1 = torch.from_numpy(input_x1)
    x2 = torch.from_numpy(input_x2)
    golden = torch.gcd(x1, x2).numpy()

    os.system("mkdir -p input")
    os.system("mkdir -p output")
    input_x1.tofile("./input/input_x1.bin")
    input_x2.tofile("./input/input_x2.bin")
    golden.tofile("./output/golden.bin")

    print(input_x1)
    print(input_x2)
    print(golden)

if __name__ == "__main__":
    gen_golden_data_simple()